<template>
    <div>
        <div class="work-box" @click="collapseClick">
            <div class="work-title">{{name}}</div>
            <div :class="isAv?'gl-av':'gl'"></div>
        </div>
        <div :style="{'height':isAv?'100%':'0px'}" class="content-box">
            <slot v-if="isAv"></slot>
        </div>
    </div>

</template>
<script>
export default {
    props:{
        name:{
            type:String
        }
    },
    data() {
        return {
            isAv:false
        }
    },
    methods:{
            collapseClick() {
                this.isAv = !this.isAv
            }
    }
}
</script>
<style scoped>
.content-box{
    overflow: hidden;
    transition: all 0.8s;
}
.work-box{
            width: 100%;
            height: 50px;
            box-shadow:2px 2px 3px rgb(219, 218, 218);
            display: flex;
            padding: 0 0.6rem 0 0.3rem;
            justify-content: space-between;
            align-items: center;
            box-sizing: border-box;
        }
        .work-title{
            font-size: 0.3rem;
        }
        .gl{
            margin-top: 12px;
            width: 12px;
            height: 12px;
            border-left: 1px solid #999;
            border-bottom: 1px solid #999;
            -webkit-transform: translate(0,-50%) rotate(-135deg);
            transform: translate(0,-50%) rotate(-135deg);
            transition: all 0.8s;

        }
        .gl-av{
            margin-top: 12px;
            width: 12px;
            height: 12px;
            border-left: 1px solid #999;
            border-bottom: 1px solid #999;
            -webkit-transform: translate(0,-50%) rotate(-45deg);
            transform: translate(0,-50%) rotate(-45deg);
            transition: all 0.8s;
        }
</style>